package com.bjpowernode.dataservice.mapper;

import com.bjpowernode.api.model.RechargeRecord;
import com.bjpowernode.api.vo.RechargeInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RechargeRecordMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(RechargeRecord record);

    int insertSelective(RechargeRecord record);

    RechargeRecord selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(RechargeRecord record);

    int updateByPrimaryKey(RechargeRecord record);

    /**
     * 查询用户最近充值记录，分页查询
     * @param userId
     * @param offset
     * @param
     * @return
     */
    List<RechargeInfo> selectByUserId(@Param("userId") Integer userId, @Param("offset") int offset, @Param("rows") Integer pageSize);

    /**
     * 根据订单号，查询充值记录
     * @param orderId
     * @return
     */
    RechargeRecord selectByOrderId(@Param("orderId") String orderId);

    /**
     * 更新充值记录状态
     * @param id
     * @param newStatus
     * @return
     */
    int updateStatus(@Param("id") Integer id, @Param("newStatus") int newStatus);

}